package com.Demo;

import com.dao.MyClassDao;
import com.model.MyClass;

import java.util.Scanner;

public class Demo05_insertMyClass {
    public static void main(String[] args) {
        System.out.println("请输入要增添的班级名:");
        Scanner scanner = new Scanner(System.in);
        String inputName = scanner.next();

        MyClass myClass = new MyClass();
        myClass.setName(inputName);

        MyClassDao myClassDao = new MyClassDao();
        int row = myClassDao.insert(myClass);
        if (row == 1) {
            System.out.println("插入成功");
        } else {
            System.out.println("插入失败");
        }
    }
}
